/***************************************************************************************************
  *Copyright(C),2010-2016,Sumscope
  *FileName	:  CBondInfoDebug.cpp
  *Author	:  scofined.qi
  *Version	:  1.0
  *Date		:  2017/08/08
  *Desc		:  //用于主要说明此程序文件完成的主要功能
  *Relation :  
  *Others	:  //其他内容说明
  *Function :  //主要函数列表，每条记录应包含函数名及功能简要说明
  *History	:  //修改历史记录列表，每条修改记录应包含修改日期、修改者及修改内容简介
***************************************************************************************************/
#include "qbprotocol/include/SSFilters.h"
#include "../BondInfo.h"
#include "../BondContainer.h"
#include "CBondInfoDebug.h"
#include "CBondInfoImpl.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifdef	_DEBUG
//#define	new	DEBUG_NEW
#endif
//#ifndef	_SP_ENABLE_INLINES
//#define	_BOND_INLINE
//#include "../BondInfo.inl"
//#undef	_BOND_INLINE
//#endif //_SP_ENABLE_INLINES
// 开启宏BONDINFO_STAT,将会在CBondInfo的每个函数接口的入口处增加USE_FIELD(CBondInfoDebug,)宏,用于统计
// CBondInfo的每个字段的额使用计数
//#include "CBondInfoImpl.h"


/*
	说明:
	宏USE_DYNAMIC_SWITCH用于开启CBondInfo的具体实现的运行时切换,只能一次,每次运行后只能取一个
	宏开启后,CBondInfoDebug拥有额外的指针CBondInfoOld*	m_old
		第一次运行,检测配置变量kProfileBondInfoUseOld的值,此变量默认值是false,即m_old永远为0;
		如果此值设为true,那么m_impl将为0,以后将一直使用CBondInfoOld指针m_old;
	好处:可以在两个实现中来回切换做对比而不用重新编译
*/
namespace{
	enum kBondUsage {
		kBondUsageWrite = -1,
		kBondUsageRead = -2,
		kBondUsageLogic = -3,
		// 之所以单独编写一个operator=,是为了调试
		kReadField_sJianpin = 1,
		kReadField_sQuanpin,
		kReadField_ConversionRate,
		kReadField_sBidLimitBottom,
		kReadField_sBidLimitTop,
		kReadField_IssueRate,
		kReadField_sCouponRateCurrent,
		kReadField_sWarranter,
		kReadField_sBondTag,

		kReadField_sFullName,
		kReadField_sFullNameEn,
		kReadField_sShortNameEn,

		kReadField_sShortName,
		kReadField_sCombBondKey,
		kReadField_sBondKey,
		kReadField_sCombBondID,
		kReadField_sRemainDate,
		kReadField_sRemainDateDisplay,
		kReadField_sTermToMaturity,
		kReadField_sIssueEndTime,
		kReadField_sAuctionDateTime,

		// 日期字段优化
		kReadField_NextCoupon_Date,
		kReadField_PlannedExerciseDate,
		kReadField_sAuctionDateEnd,
		kReadField_sOptionDate,
		kReadField_sAuctionDateStart,
		kReadField_sIssueEndDate,
		kReadField_sPaymentDate,
		kReadField_sAnnounceDate,
		kReadField_sIssueStartDate,
		kReadField_sInterestStartDate,
		kReadField_sListDate,
		kReadField_sMaturityDate,
		kReadField_nPayDate,

		// 小字符串优化
		kReadField_sYieldCurveType,
		kReadField_sJointUnderwriters,
		kReadField_sUnderwrites,
		kReadField_sIssuerRatingInstitutionCode,
		kReadField_sAuction_Unit,
		kReadField_sIssueType,
		kReadField_sOutlook,
		kReadField_sListedMarket,
		kReadField_sOptionType,
		kReadField_sAutcionType,
		kReadField_sEntCor,
		kReadField_sInstitutionType,
		kReadField_sMarketType,
		kReadField_sBondSubType,
		kReadField_sInterestBasis,
		kReadField_sCBRRating,
		kReadField_sChinaDCState,
		kReadField_sCDCRating,
		kReadField_sCSIRating,
		kReadField_sCouponFrequency,
		kReadField_sCompoundFrequency,
		kReadField_sWarrant,
		kReadField_sMainUnderwriters,
		kReadField_sIssuePeriod,
		kReadField_sAuction_Step,
		kReadField_sFRNIndexID,
		kReadField_sIssuerRating,
		kReadField_sBondRating,
		kReadField_sInstitutionRating,
		kReadField_sRateType,
		kReadField_sCouponType,
		kReadField_sMaturityTerm,
		kReadField_sBondID,
		kReadField_sCSCleanPrice,
		kReadField_sCSYield,
		kReadField_sEstcleanprice,
		kReadField_sEstPrice,
		kReadField_sEstOption,
		kReadField_sAuction_Cap,
		kReadField_sAuction_Flr,
		kReadField_sFixingMADays,
		kReadField_sCSModifyDuration,
		kReadField_sDuration,
		kReadField_sIssuerCode,
		kReadField_fPlannedIssueAmount,
		kReadField_fActualIssueAmount,
		kReadField_fOutstandingAmount,
		kReadField_nBondFileNum,
		kReadField_nAdditionInfoIndex,
		kReadField_nOptionInfoIndex,
		kReadField_nEstDate,
		kReadField_nCSDate,
		kReadField_nAuctionTimeStart,
		kReadField_nAuctionTimeEnd,
		kReadField_nCdcAuth,
		kReadField_flag,
		kReadField_sAssetStatus,
		kReadField_sCurrency,
		kReadField_CategoryFlag
	};

	bool UseOld(){
		static bool init = false;
		static bool useold = false;
		if (!init){
			init = true;
		}
		return useold;
	}
	bool IsSplitBondInfoEnable(){
		static bool init = false;
		static bool enable = false;
		if (!init)
		{
			enable = false;// boolTEST(kProfileSplitBondInfo);
			init = true;
		}
		return enable;
	}
	int GetBondShortNameUseField(){
		//if (strcmp(AfxGetLanguageID(), "EN") == 0)
		if(false)
		{
			return kReadField_sFullNameEn;
		}
		else
		{
			return kReadField_sShortName;
		}
	}
}

#define GET_CACHE(MEMBER) 
#define CALL_CACHE(EXPR) 
#define SET_CACHE(MEMBER,VAL) 

#define CALLFUNC(IMPL,FUNC) 	return IMPL->FUNC();
#define CALLFUNC1(IMPL,FUNC,ARG) 	return IMPL->FUNC(ARG);
#define CALLFUNC2(IMPL,FUNC,ARG1,ARG2)	return IMPL->FUNC(ARG1,ARG2);
#define CALLFUNC3(IMPL,FUNC,ARG1,ARG2,ARG3) return IMPL->FUNC(ARG1,ARG2,ARG3);
#define CALLFUNC4(IMPL,FUNC,ARG1,ARG2,ARG3,ARG4) return IMPL->FUNC(ARG1,ARG2,ARG3,ARG4);

#define FLAG_CALLFUNC(IMPL,FUNC)	CALLFUNC(IMPL,FUNC);

CBondInfoDebug::CBondInfoDebug(){
	m_impl = new CBondInfoImpl();
}
CBondInfoDebug::~CBondInfoDebug(){
	if (m_impl)
	{ 
		delete m_impl;
		m_impl = NULL; 
	}
}
CBondInfoDebug::CBondInfoDebug(const CBondInfoDebug& bi)
{
	m_impl = new CBondInfoImpl(*bi.m_impl);
}
CBondInfoDebug& CBondInfoDebug::operator= (const CBondInfoDebug& bi)
{
	return Clone(bi);
}
CBondInfoDebug& CBondInfoDebug::Clone(const CBondInfoDebug& bi)
{
	if (this != &bi) {
		if (m_impl != NULL)delete m_impl;
			m_impl = new CBondInfoImpl(*bi.m_impl);
	}
	return *this;
}
void CBondInfoDebug::Clear(){CALLFUNC(GetBondPtr(),Clear);}
bool CBondInfoDebug::IsCodeEqualTo(const char * szBondID, const char * szListedMarket)const{ CALLFUNC2(GetBondPtr(),IsCodeEqualTo,szBondID,szListedMarket); }
bool CBondInfoDebug::IsKeyEqualTo(const char * szBondKey, const char * szListedMarket)const{ CALLFUNC2(GetBondPtr(),IsKeyEqualTo,szBondKey,szListedMarket); }
void CBondInfoDebug::SetBondKey(const char* szKey){CALLFUNC1(GetBondPtr(),SetBondKey,szKey);}
void CBondInfoDebug::SetBondCode(const char* szCode){CALLFUNC1(GetBondPtr(),SetBondCode,szCode);}
void CBondInfoDebug::SetCombBondKey(const char* szKey){CALLFUNC1(GetBondPtr(),SetCombBondKey,szKey);}
void CBondInfoDebug::SetCombBondCode(const char* szCode){CALLFUNC1(GetBondPtr(),SetCombBondCode,szCode);}
void CBondInfoDebug::SetMaturityTerm(const char* szMaturityTerm){CALLFUNC1(GetBondPtr(),SetMaturityTerm,szMaturityTerm);}
void CBondInfoDebug::SetPlannedIssueAmount(double fPlannedIssueAmount){CALLFUNC1(GetBondPtr(),SetPlannedIssueAmount,fPlannedIssueAmount);}
void CBondInfoDebug::SetActualIssueAmount(double fActualIssueAmount){CALLFUNC1(GetBondPtr(),SetActualIssueAmount,fActualIssueAmount);}
void CBondInfoDebug::SetOutstandingAmount(double fOutstandingAmount){CALLFUNC1(GetBondPtr(),SetOutstandingAmount,fOutstandingAmount);}
void CBondInfoDebug::SetPaymentDate(const char* szPaymentDate){CALLFUNC1(GetBondPtr(),SetPaymentDate,szPaymentDate);}
void CBondInfoDebug::SetPayDate(int nDate) { CALLFUNC1(GetBondPtr(), SetPayDate, nDate); }
void CBondInfoDebug::SetIssuerCode(const char* szIssuerCode){CALLFUNC1(GetBondPtr(),SetIssuerCode,szIssuerCode);}
void CBondInfoDebug::SetCouponRateCurrent(const char* szCouponRateCurrent) { CALLFUNC1(GetBondPtr(), SetCouponRateCurrent, szCouponRateCurrent); }
void CBondInfoDebug::SetWarranter(const char* szWarranter) { CALLFUNC1(GetBondPtr(), SetWarranter, szWarranter); }
void CBondInfoDebug::SetBondTag(const char* szBondTag) { CALLFUNC1(GetBondPtr(), SetBondTag, szBondTag); }

void CBondInfoDebug::SetAutcionType(const char* szAutcionType){CALLFUNC1(GetBondPtr(),SetAutcionType,szAutcionType);}
void CBondInfoDebug::SetAuctionDateStart(const char* szAuctionDateStart){CALLFUNC1(GetBondPtr(),SetAuctionDateStart,szAuctionDateStart);}
void CBondInfoDebug::SetAuctionDateEnd(const char* szAuctionDateEnd){CALLFUNC1(GetBondPtr(),SetAuctionDateEnd,szAuctionDateEnd);}
void CBondInfoDebug::SetAuctionDateTime(const char* szAuctionDateTime){CALLFUNC1(GetBondPtr(),SetAuctionDateTime,szAuctionDateTime);}
void CBondInfoDebug::SetAnnounceDate(const char* szAnnounceDate){CALLFUNC1(GetBondPtr(),SetAnnounceDate,szAnnounceDate);}
void CBondInfoDebug::SetIssueStartDate(const char* szIssueStartDate){CALLFUNC1(GetBondPtr(),SetIssueStartDate,szIssueStartDate);}
void CBondInfoDebug::SetIssueEndDate(const char* szIssueEndDate){CALLFUNC1(GetBondPtr(),SetIssueEndDate,szIssueEndDate);}
void CBondInfoDebug::SetIssueEndTime(const char* szIssueEndTime){CALLFUNC1(GetBondPtr(),SetIssueEndTime,szIssueEndTime);}
void CBondInfoDebug::SetIssuePeriod(const char* szIssuePeriod){CALLFUNC1(GetBondPtr(),SetIssuePeriod,szIssuePeriod);}
void CBondInfoDebug::SetAuctionTimeStart(int nAuctionTimeStart){CALLFUNC1(GetBondPtr(),SetAuctionTimeStart,nAuctionTimeStart);}
void CBondInfoDebug::SetAuctionTimeEnd(int nAuctionTimeEnd){CALLFUNC1(GetBondPtr(),SetAuctionTimeEnd,nAuctionTimeEnd);}
void CBondInfoDebug::SetOptionType(const char* szOptionType){CALLFUNC1(GetBondPtr(),SetOptionType,szOptionType);}
void CBondInfoDebug::SetTermToMaturity(const char* szTermToMaturity){CALLFUNC1(GetBondPtr(),SetTermToMaturity,szTermToMaturity);}
void CBondInfoDebug::SetBondName(const char* szName){CALLFUNC1(GetBondPtr(),SetBondName,szName);}
void CBondInfoDebug::SetBondNameEn(const char* szNameEn){CALLFUNC1(GetBondPtr(),SetBondNameEn,szNameEn);}
void CBondInfoDebug::SetSceniority(const char* szSceniority) { CALLFUNC1(GetBondPtr(), SetSceniority, szSceniority); }
void CBondInfoDebug::SetCategoryFlag(const char* szCategoryFlag) { CALLFUNC1(GetBondPtr(), SetCategoryFlag, szCategoryFlag); }

const char * CBondInfoDebug::GetBondShortName()const{ 
	GET_CACHE(m_sShortName.c_str());
	CALLFUNC(GetBondPtr(GetBondShortNameUseField()), GetBondShortName);
	
}
std::string CBondInfoDebug::GetBondNameEn()const {  CALLFUNC(GetBondPtr(kReadField_sFullNameEn), GetBondNameEn); }
std::string CBondInfoDebug::GetBondShortNameEn()const{  CALLFUNC(GetBondPtr(kReadField_sShortNameEn), GetBondShortNameEn); }
void CBondInfoDebug::SetBondShortName(const char* szShortName){CALLFUNC1(GetBondPtr(),SetBondShortName,szShortName);}
void CBondInfoDebug::SetBondShortNameEn(const char* szShortNameEn){CALLFUNC1(GetBondPtr(),SetBondShortNameEn,szShortNameEn);}
void CBondInfoDebug::SetFRNIndexID(const char* szIndexID){CALLFUNC1(GetBondPtr(),SetFRNIndexID,szIndexID);}
void CBondInfoDebug::SetFixingMADays(const char* szFixingMADays){   CALLFUNC1(GetBondPtr(),SetFixingMADays,szFixingMADays);}
void CBondInfoDebug::SetMaturityDate(const char* szDate){CALLFUNC1(GetBondPtr(),SetMaturityDate,szDate);}
void CBondInfoDebug::SetBondRating(const char* szCurrent){CALLFUNC1(GetBondPtr(),SetBondRating,szCurrent);}
void CBondInfoDebug::SetIssuerRating(const char* szIssuerRating){CALLFUNC1(GetBondPtr(),SetIssuerRating,szIssuerRating);}
void CBondInfoDebug::SetIssuerRatingInstitutionCode(const char* sIssuerRatingInstitutionCode){CALLFUNC1(GetBondPtr(),SetIssuerRatingInstitutionCode,sIssuerRatingInstitutionCode);}
void CBondInfoDebug::SetInstitutionRating(const char* sInstitutionRating){CALLFUNC1(GetBondPtr(),SetInstitutionRating,sInstitutionRating);}
void CBondInfoDebug::SetMarketType(const char* szMarketType){CALLFUNC1(GetBondPtr(),SetMarketType,szMarketType);}
void CBondInfoDebug::SetInterestStartDate(const char* szStartdate){CALLFUNC1(GetBondPtr(),SetInterestStartDate,szStartdate);}
//void CBondInfoDebug::SetCSDate(uint32_t nCSDate){ CALLFUNC1(GetBondPtr(), SetCSDate, nCSDate); }

// 这四个接口实现有些特殊,参见CBondContainer::ClearCDCData()
// 此函数中,会触发CBondInfo写入,导致过期债券对象会被唤醒,这里实现,只做特殊的标记
// 这四个成员都是简单成员,即Set/Get只是更新此成员,不读写其他成员
// 这四个成员都是各自独立的,即在CBondInfoImpl.cpp中,对应成员不会被其他读写接口引用



void CBondInfoDebug::SetYieldCurveType(const char* szCurveType){CALLFUNC1(GetBondPtr(),SetYieldCurveType,szCurveType);}
//void CBondInfoDebug::SetCSYield(const char* szYield){CALLFUNC1(GetBondPtr(),SetCSYield,szYield);}
//void CBondInfoDebug::SetCSCleanPrice(const char* szPrice){CALLFUNC1(GetBondPtr(),SetCSCleanPrice,szPrice);}
//void CBondInfoDebug::SetCSModifyDuration(const char* szDuration){CALLFUNC1(GetBondPtr(),SetCSModifyDuration,szDuration);}
void CBondInfoDebug::SetOptionDate(const char* szOptionDate){CALLFUNC1(GetBondPtr(),SetOptionDate,szOptionDate);}
const char* CBondInfoDebug::GetTermToMaturity()const{  CALLFUNC(GetBondPtr(),GetTermToMaturity);}
const char* CBondInfoDebug::GetTermToMaturity2D()const{  CALLFUNC(GetBondPtr(kReadField_sTermToMaturity), GetTermToMaturity2D); }
const char * CBondInfoDebug::GetFRNIndexID()const{  CALLFUNC(GetBondPtr(kReadField_sFRNIndexID), GetFRNIndexID); }
const char * CBondInfoDebug::GetFixingMADays()const{  CALLFUNC(GetBondPtr(kReadField_sFixingMADays), GetFixingMADays); }
const char* CBondInfoDebug::GetCouponRateCurrent()const {  CALLFUNC(GetBondPtr(kReadField_sCouponRateCurrent), GetCouponRateCurrent); }
const char* CBondInfoDebug::GetWarranter() const {  CALLFUNC(GetBondPtr(kReadField_sWarranter), GetWarranter); }
const char* CBondInfoDebug::GetBondTag() const {  CALLFUNC(GetBondPtr(kReadField_sBondTag), GetBondTag); }

double CBondInfoDebug::GetPlannedIssueAmount()const {  CALLFUNC(GetBondPtr(kReadField_fPlannedIssueAmount), GetPlannedIssueAmount); }
double CBondInfoDebug::GetActualIssueAmount()const {  CALLFUNC(GetBondPtr(kReadField_fActualIssueAmount), GetActualIssueAmount); }
double CBondInfoDebug::GetOutstandingAmount()const {   CALLFUNC(GetBondPtr(kReadField_fOutstandingAmount), GetOutstandingAmount); }
const char * CBondInfoDebug::GetIssuerCode()const{  CALLFUNC(GetBondPtr(kReadField_sIssuerCode), GetIssuerCode); }
const char* CBondInfoDebug::GetInstitutionType()const {  CALLFUNC(GetBondPtr(kReadField_sInstitutionType), GetInstitutionType); }
const char * CBondInfoDebug::GetYieldCurveType()const{  CALLFUNC(GetBondPtr(kReadField_sYieldCurveType), GetYieldCurveType); }

const char *  CBondInfoDebug::GetCBRRating() const{  CALLFUNC(GetBondPtr(kReadField_sCBRRating), GetCBRRating); }
const char *  CBondInfoDebug::GetChinaDCState() const{  CALLFUNC(GetBondPtr(kReadField_sChinaDCState), GetChinaDCState); }

const char *  CBondInfoDebug::GetCDCRating() const{  CALLFUNC(GetBondPtr(kReadField_sCDCRating), GetCDCRating); }
const char *  CBondInfoDebug::GetCSIRating() const {  CALLFUNC(GetBondPtr(kReadField_sCSIRating), GetCSIRating); }
const char *  CBondInfoDebug::GetCurrency() const {  CALLFUNC(GetBondPtr(kReadField_sCurrency), GetCurrency); }

//uint32_t CBondInfoDebug::GetCSDate()const{ CALLFUNC(GetBondPtr(kReadField_nCSDate), GetCSDate); }
//const char * CBondInfoDebug::GetCSYield()const{ CALLFUNC(GetBondPtr(kReadField_sCSYield), GetCSYield); }
//const char * CBondInfoDebug::GetCSCleanPrice()const{ CALLFUNC(GetBondPtr(kReadField_sCSCleanPrice), GetCSCleanPrice); }
//const char * CBondInfoDebug::GetCSModifyDuration()const{ CALLFUNC(GetBondPtr(kReadField_sCSModifyDuration), GetCSModifyDuration); }
const char * CBondInfoDebug::GetAutcionType()const{  CALLFUNC(GetBondPtr(kReadField_sAutcionType), GetAutcionType); }
const char * CBondInfoDebug::GetAuctionDateStart()const{  CALLFUNC(GetBondPtr(kReadField_sAuctionDateStart), GetAuctionDateStart); }
const char * CBondInfoDebug::GetAuctionDateEnd()const{  CALLFUNC(GetBondPtr(kReadField_sAuctionDateEnd), GetAuctionDateEnd); }
const char * CBondInfoDebug::GetAuctionDateTime()const{  CALLFUNC(GetBondPtr(kReadField_sAuctionDateTime), GetAuctionDateTime); }
const char * CBondInfoDebug::GetAnnounceDate()const{  CALLFUNC(GetBondPtr(kReadField_sAnnounceDate), GetAnnounceDate); }
void CBondInfoDebug::SetInstitutionType(const char* szInsType){CALLFUNC1(GetBondPtr(),SetInstitutionType,szInsType);}
void CBondInfoDebug::SetListDate(const char* szListDate){CALLFUNC1(GetBondPtr(),SetListDate,szListDate);}

void CBondInfoDebug::SetRateType(const char* szRateType){CALLFUNC1(GetBondPtr(),SetRateType,szRateType);}
void CBondInfoDebug::SetCouponType(const char* szCouponType){CALLFUNC1(GetBondPtr(),SetCouponType,szCouponType);}
void CBondInfoDebug::SetCouponFrequency(const char* szCouponFrequency){CALLFUNC1(GetBondPtr(),SetCouponFrequency,szCouponFrequency);}
void CBondInfoDebug::SetCompoundFrequency(const char* szCompoundFrequency){CALLFUNC1(GetBondPtr(),SetCompoundFrequency,szCompoundFrequency);}
void CBondInfoDebug::SetInterestBasis(const char* szInterestBasis){CALLFUNC1(GetBondPtr(),SetInterestBasis,szInterestBasis);}
long CBondInfoDebug::GetRemainedDays(time_t tNow)const {   CALLFUNC1(GetBondPtr(), GetRemainedDays, tNow); }
void CBondInfoDebug::SetMainUnderwriters(const char* sUnderwriters){CALLFUNC1(GetBondPtr(),SetMainUnderwriters,sUnderwriters);}
void CBondInfoDebug::SetJointUnderwriters(const char* sUnderwriters){CALLFUNC1(GetBondPtr(),SetJointUnderwriters,sUnderwriters);}
void CBondInfoDebug::SetUnderwrites(const char* sUnderwrites){CALLFUNC1(GetBondPtr(),SetUnderwrites,sUnderwrites);}
void CBondInfoDebug::SetBidLimitBottom(const char* sBid){CALLFUNC1(GetBondPtr(),SetBidLimitBottom,sBid);}
void CBondInfoDebug::SetBidLimitTop(const char* sBid){CALLFUNC1(GetBondPtr(),SetBidLimitTop,sBid);}
void CBondInfoDebug::SetAuctionFlr(const char* sAuction){CALLFUNC1(GetBondPtr(),SetAuctionFlr,sAuction);}
void CBondInfoDebug::SetAuctionCap(const char* sAuction){CALLFUNC1(GetBondPtr(),SetAuctionCap,sAuction);}
void CBondInfoDebug::SetAuctionStep(const char* sStep){CALLFUNC1(GetBondPtr(),SetAuctionStep,sStep);}
void CBondInfoDebug::SetAuctionUnit(const char* sUnit){CALLFUNC1(GetBondPtr(),SetAuctionUnit,sUnit);}

void CBondInfoDebug::SetCBRRating(const char* szCBRRating){ CALLFUNC1(GetBondPtr(), SetCBRRating, szCBRRating); }
void CBondInfoDebug::SetChinaDCState(const char* szChinaDCState){ CALLFUNC1(GetBondPtr(), SetChinaDCState, szChinaDCState); }

void CBondInfoDebug::SetCDCRating(const char* szCDCRating){ CALLFUNC1(GetBondPtr(), SetCDCRating, szCDCRating); }
void CBondInfoDebug::SetCSIRating(const char* szCSIRating) { CALLFUNC1(GetBondPtr(), SetCSIRating, szCSIRating); }
void CBondInfoDebug::SetCurrency(const char* szCurrency) { CALLFUNC1(GetBondPtr(), SetCurrency, szCurrency); }

const char * CBondInfoDebug::GetRemainPeriod(time_t tNow)const{
	if (!m_impl)
		return "已过期";
	CALLFUNC1(GetBondPtr(), GetRemainPeriod, tNow); 
}


const char* CBondInfoDebug::GetRemainPeriodByIntTime(time_t tNow) const
{
	CALLFUNC1(GetBondPtr(), GetRemainPeriodByIntTime, tNow);
}

std::string CBondInfoDebug::GetHistoryRemainPeriod(time_t tday) const{
	if (!m_impl)
		return "已过期";
	CALLFUNC1(GetBondPtr(), GetHistoryRemainPeriod, tday);
}

float CBondInfoDebug::GetRemainYear(time_t tNow)const {   CALLFUNC1(GetBondPtr(), GetRemainYear, tNow); }
float CBondInfoDebug::GetRemainYearToOption(time_t tNow)const {   CALLFUNC1(GetBondPtr(), GetRemainYearToOption, tNow); }
void CBondInfoDebug::SetWarrant(const char* sWarrant){   CALLFUNC1(GetBondPtr(),SetWarrant,sWarrant);}
bool CBondInfoDebug::IsNewBond()const { CALLFUNC(GetBondPtr(), IsNewBond); }
bool CBondInfoDebug::IsWarranted()const{ CALLFUNC(GetBondPtr(kReadField_sWarrant), IsWarranted); }
bool CBondInfoDebug::IsRight()const{ CALLFUNC(GetBondPtr(), IsRight); }
bool CBondInfoDebug::IsRebated()const{ CALLFUNC(GetBondPtr(kReadField_sMarketType), IsRebated); }
bool CBondInfoDebug::IsSOEenterType()const{ CALLFUNC(GetBondPtr(kReadField_sInstitutionType), IsSOEenterType); }
bool CBondInfoDebug::IsRatingDebt()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsRatingDebt); }
bool CBondInfoDebug::IsExpireBond()const{ CALLFUNC(GetBondPtr(kReadField_sMaturityDate, kReadField_sRemainDate), IsExpireBond); }
bool CBondInfoDebug::IsInterbank()const{ CALLFUNC(GetBondPtr(kReadField_sListedMarket), IsInterbank); }
bool CBondInfoDebug::IsExchange()const{ CALLFUNC(GetBondPtr(kReadField_sListedMarket), IsExchange); }
bool CBondInfoDebug::IsSSEBond()const { CALLFUNC(GetBondPtr(kReadField_sListedMarket), IsSSEBond); }
bool CBondInfoDebug::IsSZEBond()const { CALLFUNC(GetBondPtr(kReadField_sListedMarket), IsSZEBond); }
bool CBondInfoDebug::IsBSEBond()const { CALLFUNC(GetBondPtr(kReadField_sListedMarket), IsBSEBond); }
bool CBondInfoDebug::IsFinanceBond()const{ CALLFUNC(GetBondPtr(), IsFinanceBond); }
bool CBondInfoDebug::IsCNYBond()const { CALLFUNC(GetBondPtr(), IsCNYBond); }
int CBondInfoDebug::DigitBit()const{ CALLFUNC(GetBondPtr(),DigitBit);}
bool CBondInfoDebug::MatchJianpin(const char* pstr) const{ 
	CALLFUNC1(GetBondPtr(kReadField_sShortName), MatchJianpin, pstr); 
	return false;
}
bool CBondInfoDebug::MatchQuanpin(const char* pstr) const{
	CALLFUNC1(GetBondPtr(kReadField_sShortName), MatchQuanpin, pstr); 
	return false;
}
bool CBondInfoDebug::CheckBondTypeNew(const BLHCONDITION& Cond)const		//判断产品类型，5.5.3新版筛选，最优报价
{
	for (int i = 0; i < BLH_BONDTYPECOUNT; i++)
	{
		if (Cond.nTypeNew[i] == CBondContainer::newBondNone) return false;
		if (CheckBondTypeNew(Cond.nTypeNew[i])) return true;
	}
	return false;
}

bool CBondInfoDebug::CheckBondTypeNew(UINT nSubType)const { CALLFUNC1(GetBondPtr(), CheckBondTypeNew, nSubType); }
bool CBondInfoDebug::CheckCmbcBondType(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckCmbcBondType,Cond);}
bool CBondInfoDebug::CheckBjrcbBondType(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckBjrcbBondType,Cond);}
bool CBondInfoDebug::CheckNbcbCDBondType(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckNbcbCDBondType,Cond);}
bool CBondInfoDebug::CheckNbcbIRDBondType(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckNbcbIRDBondType,Cond);}
bool CBondInfoDebug::CheckNbcbIssueBondType(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckNbcbIssueBondType,Cond);}
bool CBondInfoDebug::CheckCmbcBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckCmbcBondType,nSubType);}
bool CBondInfoDebug::CheckBjrcbBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckBjrcbBondType,nSubType);}
bool CBondInfoDebug::CheckNbcbCDBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckNbcbCDBondType,nSubType);}
bool CBondInfoDebug::CheckNbcbIRDBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckNbcbIRDBondType,nSubType);}
bool CBondInfoDebug::CheckNbcbIssueBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckNbcbIssueBondType,nSubType);}
bool CBondInfoDebug::ShortCheckBondType(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),ShortCheckBondType,Cond); }
bool CBondInfoDebug::ShortCheckBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),ShortCheckBondType,nSubType);}
bool CBondInfoDebug::CheckHYBondType(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckHYBondType, Cond); }
bool CBondInfoDebug::CheckHYBondType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckHYBondType,nSubType);}
bool CBondInfoDebug::CheckComplexBondType(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(), CheckComplexBondType, Cond); }
bool CBondInfoDebug::CheckComplexBondType(uint32_t nSubType)const { CALLFUNC1(GetBondPtr(), CheckComplexBondType, nSubType); }
bool CBondInfoDebug::CheckBankBondType(const BLHCONDITION& Cond) const { CALLFUNC1(GetBondPtr(), CheckBankBondType, Cond); }
bool CBondInfoDebug::CheckRightEx(const BLHCONDITION& Cond) const { CALLFUNC1(GetBondPtr(), CheckRightEx, Cond); }//含权类型
bool CBondInfoDebug::CheckIssuer(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckIssuer,Cond);}
bool CBondInfoDebug::CheckGuarantor(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckGuarantor, Cond); }
bool CBondInfoDebug::CheckSector(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckSector, Cond); }
bool CBondInfoDebug::CheckSector2021(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckSector2021, Cond); }
bool CBondInfoDebug::CheckArea(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(), CheckArea, Cond); }
bool CBondInfoDebug::CheckMainUnderwriter(const BLHCONDITION& Cond) const{ CALLFUNC1(GetBondPtr(), CheckMainUnderwriter, Cond); }
bool CBondInfoDebug::CheckBontSubType(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckBontSubType,Cond);}
bool CBondInfoDebug::CheckBontSubType(const char* pSubType)const{ CALLFUNC1(GetBondPtr(),CheckBontSubType,pSubType);}
bool CBondInfoDebug::CheckDebtRating(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckDebtRating,Cond);}
bool CBondInfoDebug::CheckFinDebt(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckFinDebt,Cond);}
// add  by lbl  
bool CBondInfoDebug::CheckNCDRating(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckNCDRating, Cond); }
// end 
bool CBondInfoDebug::CheckIssueYear(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(), CheckIssueYear, Cond); }
bool CBondInfoDebug::CheckIssueYear(int nYear) const{ CALLFUNC1(GetBondPtr(), CheckIssueYear, nYear); }
bool CBondInfoDebug::CheckIssueYear(int nBegin, int nEnd)const{ CALLFUNC2(GetBondPtr(), CheckIssueYear, nBegin, nEnd); }
bool CBondInfoDebug::CheckUnderwriter(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckUnderwriter,Cond);}
void CBondInfoDebug::SetValidity(bool valid){
	CALL_CACHE(m_flag.SetValidFlag(valid));
	CALLFUNC1(GetBondPtr(), SetValidity, valid);
}
//kReadField_flag 相关的接口:
bool CBondInfoDebug::GetQuotTopflag()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), GetQuotTopflag); }
bool CBondInfoDebug::IsMortgage()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), IsMortgage); }
bool CBondInfoDebug::IsCrossMarket()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), IsCrossMarket); }
bool CBondInfoDebug::IsMunicipal()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), IsMunicipal); }
bool CBondInfoDebug::IsValidBond()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), IsValidBond); }
bool CBondInfoDebug::IsExpireInHoliday()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), IsExpireInHoliday); }
int CBondInfoDebug::GetIsQuotTopflag()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), GetIsQuotTopflag); }
char CBondInfoDebug::GetMortgage()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), GetMortgage); }
char CBondInfoDebug::GetCrossmarket()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), GetCrossmarket); }
char CBondInfoDebug::GetIsMunicipal()const{ FLAG_CALLFUNC(GetBondPtr(kReadField_flag), GetIsMunicipal); }
//写入flag的相关接口
void CBondInfoDebug::SetQuotTopflag(int tp){
	CALL_CACHE(m_flag.SetStickFlag(tp));
	CALLFUNC1(GetBondPtr(), SetQuotTopflag, tp);
}
void CBondInfoDebug::SetExpireInHoliday(bool bHoliday){
	CALL_CACHE(m_flag.SetExpireInHoliday(bHoliday));
	CALLFUNC1(GetBondPtr(), SetExpireInHoliday, bHoliday);
}
void CBondInfoDebug::SetMunicipal(char sMunicipal){ 
	CALL_CACHE(m_flag.SetMunicipalFlag(sMunicipal));
	CALLFUNC1(GetBondPtr(), SetMunicipal, sMunicipal); 
}
void CBondInfoDebug::SetMortgage(char sMortgage){ 
	CALL_CACHE(m_flag.SetMortgageFlag(sMortgage));
	CALLFUNC1(GetBondPtr(), SetMortgage, sMortgage);
}
void CBondInfoDebug::SetCrossmarket(char sCrossmarket){ 
	CALL_CACHE(m_flag.SetCrossmarketFlag(sCrossmarket));
	CALLFUNC1(GetBondPtr(), SetCrossmarket, sCrossmarket);
}


bool CBondInfoDebug::IsTransBond()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsTransBond); }
bool CBondInfoDebug::IsCVBBond()const { CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsCVBBond); }
bool CBondInfoDebug::IsBondSceniority()const { CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondSceniority); }
bool CBondInfoDebug::IsBondBankSecond()const { CALLFUNC(GetBondPtr(), IsBondBankSecond); }
bool CBondInfoDebug::IsBondBankPerpetual()const { CALLFUNC(GetBondPtr(), IsBondBankPerpetual); }
bool CBondInfoDebug::IsPolicyBankSecond()const { CALLFUNC(GetBondPtr(), IsPolicyBankSecond); }
bool CBondInfoDebug::IsBondCommercialBank()const { CALLFUNC(GetBondPtr(), IsBondCommercialBank); }
bool CBondInfoDebug::IsBondTLAC()const { CALLFUNC(GetBondPtr(), IsBondTLAC); }
bool CBondInfoDebug::is_credit_bond()const{ CALLFUNC(GetBondPtr(),is_credit_bond);}
bool CBondInfoDebug::is_interest_bond()const{ CALLFUNC(GetBondPtr(),is_interest_bond);}
bool CBondInfoDebug::is_industry_bond()const { CALLFUNC(GetBondPtr(), is_industry_bond); }
bool CBondInfoDebug::IsBondFinancialInstitutions()const { CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondFinancialInstitutions); }
bool CBondInfoDebug::IsCreditBond(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),IsCreditBond,Cond);}
bool CBondInfoDebug::IsInDays(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),IsInDays,Cond);}
bool CBondInfoDebug::CheckIssueState(BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(), CheckIssueState, Cond); }
bool CBondInfoDebug::CheckAssetStatus(const BLHCONDITION & Cond) const{ CALLFUNC1(GetBondPtr(), CheckAssetStatus, Cond); }
bool CBondInfoDebug::CheckAssetStatus(uint32_t nStatus) const{ CALLFUNC1(GetBondPtr(), CheckAssetStatus, nStatus); }
bool CBondInfoDebug::CheckABSCoupon(const BLHCONDITION & Cond) const{ CALLFUNC1(GetBondPtr(), CheckABSCoupon, Cond); }
bool CBondInfoDebug::CheckABSCoupon(int nCouponType) const { CALLFUNC1(GetBondPtr(), CheckABSCoupon, nCouponType); }
bool CBondInfoDebug::CheckCouponRate(const BLHCONDITION& Cond) const { CALLFUNC1(GetBondPtr(), CheckCouponRate, Cond); }
bool CBondInfoDebug::CheckMuniArea(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckMuniArea, Cond); }
bool CBondInfoDebug::CheckLocalBondArea(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckLocalBondArea, Cond); }
bool CBondInfoDebug::CheckCategoryFlag(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), CheckCategoryFlag, Cond); }

void CBondInfoDebug::SetBondSubType(const char* szBondSubType){CALLFUNC1(GetBondPtr(),SetBondSubType,szBondSubType);}
void CBondInfoDebug::SetRemainDate(const char* sRemainDate){CALLFUNC1(GetBondPtr(),SetRemainDate,sRemainDate);}
const char* CBondInfoDebug::GetArea(bool eng)const {  CALLFUNC1(GetBondPtr(), GetArea, eng); }
const char * CBondInfoDebug::GetSwSector(bool eng)const{  CALLFUNC1(GetBondPtr(), GetSwSector, eng); }
const char * CBondInfoDebug::GetSwSubSector(bool eng)const{  CALLFUNC1(GetBondPtr(), GetSwSubSector, eng); }
bool CBondInfoDebug::IsSuperNewBond(const BLHCONDITION& Cond)const { CALLFUNC1(GetBondPtr(), IsSuperNewBond, Cond); }
const char * CBondInfoDebug::GetInstitutionShortName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetInstitutionShortName, eng); }
const char * CBondInfoDebug::GetInstitutionFullName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetInstitutionFullName, eng); }
const char *  CBondInfoDebug::GetCouponTypeName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetCouponTypeName, eng); }
const char * CBondInfoDebug::GetOptionTypeName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetOptionTypeName, eng); }
void CBondInfoDebug::SetOutlook(const char* sOutlook){CALLFUNC1(GetBondPtr(),SetOutlook,sOutlook);}
void CBondInfoDebug::SetEntCor(const char* sEntCor){CALLFUNC1(GetBondPtr(),SetEntCor,sEntCor);}
void CBondInfoDebug::SetBondFileNum(int nBondFileNum){CALLFUNC1(GetBondPtr(),SetBondFileNum,nBondFileNum);}
void CBondInfoDebug::SetAdditionInfoIndex(int nIndex){CALLFUNC1(GetBondPtr(),SetAdditionInfoIndex,nIndex);}
void CBondInfoDebug::SetOptionInfoIndex(int nIndex){ CALLFUNC1(GetBondPtr(), SetOptionInfoIndex, nIndex); }
const char *  CBondInfoDebug::GetOutlookName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetOutlookName, eng); }
const char * CBondInfoDebug::GetOutlook()const{  CALLFUNC(GetBondPtr(), GetOutlook); }
int	CBondInfoDebug::GetOutlookLevel()const {  CALLFUNC(GetBondPtr(), GetOutlookLevel); }
const char * CBondInfoDebug::GetEntCor()const{  CALLFUNC(GetBondPtr(), GetEntCor); }
int CBondInfoDebug::GetBondFileNum()const {  CALLFUNC(GetBondPtr(kReadField_nBondFileNum), GetBondFileNum); }
int CBondInfoDebug::GetOptionInfoIndex()const {  CALLFUNC(GetBondPtr(kReadField_nOptionInfoIndex), GetOptionInfoIndex); }
const char * CBondInfoDebug::GetIssueRate()const{  CALLFUNC(GetBondPtr(kReadField_IssueRate), GetIssueRate); }
const char * CBondInfoDebug::GetPlannedExerciseDate()const{  CALLFUNC(GetBondPtr(kReadField_PlannedExerciseDate), GetPlannedExerciseDate); }
const char * CBondInfoDebug::GetNextCoupon_Date()const{  CALLFUNC(GetBondPtr(kReadField_NextCoupon_Date), GetNextCoupon_Date); }
const char * CBondInfoDebug::GetConversionRate()const{  CALLFUNC(GetBondPtr(kReadField_ConversionRate), GetConversionRate); }
const char * CBondInfoDebug::GetAssetStatus()const{  CALLFUNC(GetBondPtr(kReadField_sAssetStatus), GetAssetStatus); }
const char* CBondInfoDebug::GetPrincipalPayType() const {  CALLFUNC(GetBondPtr(), GetPrincipalPayType); }
bool CBondInfoDebug::IsAmortizing() const {  CALLFUNC(GetBondPtr(), IsAmortizing); }
bool CBondInfoDebug::IsNonAmortizing() const {  CALLFUNC(GetBondPtr(), IsNonAmortizing); }

int CBondInfoDebug::GetCdcAuth()const {  CALLFUNC(GetBondPtr(kReadField_nCdcAuth), GetCdcAuth); }
const CAdditionBondInfo* CBondInfoDebug::GetAdditionInfo()const { return nullptr; CALLFUNC(GetBondPtr(), GetAdditionInfo); }
bool CBondInfoDebug::IsAddIssueBond()const { CALLFUNC(GetBondPtr(), IsAddIssueBond); }
bool CBondInfoDebug::IsFilterOutAddIssueBond()const{ CALLFUNC(GetBondPtr(), IsFilterOutAddIssueBond); }
bool CBondInfoDebug::IsBondCountry()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondCountry); }
bool CBondInfoDebug::IsBondCenter()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondCenter); }
bool CBondInfoDebug::IsBondFinance()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondFinance); }
bool CBondInfoDebug::IsBondLocal()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondLocal); }
bool CBondInfoDebug::IsBondShort()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondShort); }
bool CBondInfoDebug::IsBondShort_S()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondShort_S); }
bool CBondInfoDebug::IsBondCShort()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondCShort); }
bool CBondInfoDebug::IsBondChina()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondChina); }
bool CBondInfoDebug::IsBondEnterpr()const{ CALLFUNC(GetBondPtr(), IsBondEnterpr); }
bool CBondInfoDebug::IsBondCorporate()const{ CALLFUNC(GetBondPtr(), IsBondCorporate); }
bool CBondInfoDebug::IsBondNonPublicCor()const{ CALLFUNC(GetBondPtr(),IsBondNonPublicCor);}
bool CBondInfoDebug::IsBondPPN()const{ CALLFUNC(GetBondPtr(),IsBondPPN);}
bool CBondInfoDebug::IsBondCOP()const{ CALLFUNC(GetBondPtr(), IsBondCOP); }
bool CBondInfoDebug::IsBondNCD()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondNCD); }
bool CBondInfoDebug::IsBondOther()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondOther); }
bool CBondInfoDebug::IsPrivateDebet()const{ CALLFUNC(GetBondPtr(),IsPrivateDebet);}
bool CBondInfoDebug::IsPrivateCorpBond()const{ CALLFUNC(GetBondPtr(),IsPrivateCorpBond);}
bool CBondInfoDebug::IsPubliceCorpBond()const{ CALLFUNC(GetBondPtr(), IsPubliceCorpBond); }
bool CBondInfoDebug::IsETSBond()const{ CALLFUNC(GetBondPtr(kReadField_sOptionType), IsETSBond); }
bool CBondInfoDebug::IsBondABS()const{ CALLFUNC(GetBondPtr(),IsBondABS);}
bool CBondInfoDebug::IsBondGKZ()const{ CALLFUNC(GetBondPtr(),IsBondGKZ);}
bool CBondInfoDebug::IsBondPDB()const{ CALLFUNC(GetBondPtr(kReadField_sBondSubType), IsBondPDB); }
bool CBondInfoDebug::IsBondSecondCapital()const{ CALLFUNC(GetBondPtr(),IsBondSecondCapital);}
const char *  CBondInfoDebug::GetIssuerBondRating() const{  CALLFUNC(GetBondPtr(), GetIssuerBondRating); }
const char* CBondInfoDebug::GetIssuerRatingEx()const {  CALLFUNC(GetBondPtr(), GetIssuerRatingEx); }
bool CBondInfoDebug::CheckBondSubType(const std::string& sType)const{ CALLFUNC1(GetBondPtr(),CheckBondSubType,sType); }
bool CBondInfoDebug::IsListedCompany()const{ CALLFUNC(GetBondPtr(),IsListedCompany);}
bool CBondInfoDebug::IsCBRC_Financing_Platform()const{ CALLFUNC(GetBondPtr(),IsCBRC_Financing_Platform);}
bool CBondInfoDebug::IsCDCAuthValid()const{ CALLFUNC(GetBondPtr(), IsCDCAuthValid); }
bool CBondInfoDebug::CheckCommonUseType(const BLHCONDITION & Cond)const{ CALLFUNC1(GetBondPtr(),CheckCommonUseType,Cond);}
bool CBondInfoDebug::CheckCommonUseType(uint32_t nSubType)const{ CALLFUNC1(GetBondPtr(),CheckCommonUseType,nSubType);}
bool CBondInfoDebug::IsCommonUseType(const char* sType, int swLevel) const { CALLFUNC2(GetBondPtr(), IsCommonUseType, sType, swLevel); }
void CBondInfoDebug::SetIssueRate(const char* sIssueRate){CALLFUNC1(GetBondPtr(),SetIssueRate,sIssueRate);}
void CBondInfoDebug::SetPlannedExerciseDate(const char* sDate){CALLFUNC1(GetBondPtr(),SetPlannedExerciseDate,sDate);}
void CBondInfoDebug::SetNextCoupon_Date(const char* sDate){CALLFUNC1(GetBondPtr(),SetNextCoupon_Date,sDate);}
void CBondInfoDebug::SetConversionRate(const char* sRate){   CALLFUNC1(GetBondPtr(),SetConversionRate,sRate);}
void CBondInfoDebug::SetAssetStatus(const char* sAssetStatus){ CALLFUNC1(GetBondPtr(), SetAssetStatus, sAssetStatus); }
void CBondInfoDebug::SetCdcAuth(int nCdcAuth){ CALLFUNC1(GetBondPtr(), SetCdcAuth, nCdcAuth); }
void CBondInfoDebug::SetPrincipalPayType(const char* sPrincipayPayType) { CALLFUNC1(GetBondPtr(), SetPrincipalPayType, sPrincipayPayType); }


bool CBondInfoDebug::IsGreenBond(void) const { CALLFUNC(GetBondPtr(), IsGreenBond); }
bool CBondInfoDebug::IsCarbonNeutrality(void) const { CALLFUNC(GetBondPtr(), IsCarbonNeutrality); }
bool CBondInfoDebug::IsBondInsurance(void) const { CALLFUNC(GetBondPtr(), IsBondInsurance); }

const char * CBondInfoDebug::GetBondKey()const{  CALLFUNC(GetBondPtr(), GetBondKey); }
const char * CBondInfoDebug::GetBondCode()const{  CALLFUNC(GetBondPtr(), GetBondCode); }

void CBondInfoDebug::SetListedMarket(const char* szListedMarket){
	CALLFUNC1(GetBondPtr(), SetListedMarket, szListedMarket);
}

const char * CBondInfoDebug::GetListedMarket()const{ 
	GET_CACHE(m_sListedMarket);
	CALLFUNC(GetBondPtr(), GetListedMarket); 
}
const char * CBondInfoDebug::GetCombBondKey()const{CALLFUNC(GetBondPtr(kReadField_sCombBondKey), GetCombBondKey); }
const char * CBondInfoDebug::GetCombBondCode()const{ 
	//DictUpdateManager::BuildSpellIndex中会用到
	GET_CACHE(m_sCombBondID);
	CALLFUNC(GetBondPtr(kReadField_sCombBondID), GetCombBondCode);
}
std::string CBondInfoDebug::GetBondJianpin()const{
	CALLFUNC(GetBondPtr(kReadField_sShortName), GetBondJianpin);
	
}
std::string CBondInfoDebug::GetBondQuanpin()const{
	CALLFUNC(GetBondPtr(kReadField_sShortName), GetBondQuanpin);
	
}
const char * CBondInfoDebug::GetMarketType()const{  CALLFUNC(GetBondPtr(kReadField_sMarketType), GetMarketType); }
const char * CBondInfoDebug::GetBondSubType()const{  CALLFUNC(GetBondPtr(kReadField_sBondSubType), GetBondSubType); }
const char * CBondInfoDebug::GetIssuerRating()const{  CALLFUNC(GetBondPtr(kReadField_sIssuerRating), GetIssuerRating); }
const char * CBondInfoDebug::GetIssuerRatingInstitutionCode()const{  CALLFUNC(GetBondPtr(kReadField_sIssuerRatingInstitutionCode), GetIssuerRatingInstitutionCode); }
const char * CBondInfoDebug::GetInstitutionRating()const{  CALLFUNC(GetBondPtr(kReadField_sInstitutionRating), GetInstitutionRating); }
const char * CBondInfoDebug::GetBondRating()const{  CALLFUNC(GetBondPtr(kReadField_sBondRating), GetBondRating); }
const char * CBondInfoDebug::GetListDate()const{  CALLFUNC(GetBondPtr(kReadField_sListDate), GetListDate); }
const char * CBondInfoDebug::GetInterestStartDate()const{  CALLFUNC(GetBondPtr(kReadField_sInterestStartDate), GetInterestStartDate); }
const char * CBondInfoDebug::GetMaturityDate()const{ 
	GET_CACHE(m_sMaturityDate);
	CALLFUNC(GetBondPtr(kReadField_sMaturityDate), GetMaturityDate); 
	
}
int CBondInfoDebug::GetPayDate()const { CALLFUNC(GetBondPtr(kReadField_nPayDate), GetPayDate); }
const char * CBondInfoDebug::GetPaymentDate()const{  CALLFUNC(GetBondPtr(kReadField_sPaymentDate), GetPaymentDate); }
const char * CBondInfoDebug::GetOptionDate()const{  CALLFUNC(GetBondPtr(kReadField_sOptionDate), GetOptionDate); }
const char * CBondInfoDebug::GetRateType()const{  CALLFUNC(GetBondPtr(kReadField_sRateType), GetRateType); }
const char * CBondInfoDebug::GetCouponType()const{  CALLFUNC(GetBondPtr(kReadField_sCouponType), GetCouponType); }
const char * CBondInfoDebug::GetCouponFrequency()const{  CALLFUNC(GetBondPtr(kReadField_sCouponFrequency), GetCouponFrequency); }
const char * CBondInfoDebug::GetCompoundFrequency()const{  CALLFUNC(GetBondPtr(kReadField_sCompoundFrequency), GetCompoundFrequency); }
const char * CBondInfoDebug::GetInterestBasis()const{  CALLFUNC(GetBondPtr(kReadField_sInterestBasis), GetInterestBasis); }
const char * CBondInfoDebug::GetOptionType()const{  CALLFUNC(GetBondPtr(kReadField_sOptionType), GetOptionType); }
const char * CBondInfoDebug::GetMaturityTerm()const{  CALLFUNC(GetBondPtr(kReadField_sMaturityTerm), GetMaturityTerm); }
bool CBondInfoDebug::IsBondPrivate()const{  CALLFUNC(GetBondPtr(), IsBondPrivate); }
const char * CBondInfoDebug::GetRatingInstitutionShortName(bool eng)const{  CALLFUNC1(GetBondPtr(), GetRatingInstitutionShortName, eng); }
void CBondInfoDebug::SetIssueType(const char* szIssueType){CALLFUNC1(GetBondPtr(),SetIssueType,szIssueType);}
int CBondInfoDebug::GetIssueType() {   CALLFUNC(GetBondPtr(kReadField_sIssueType), GetIssueType); }
int CBondInfoDebug::GetIssueTypePurchase() {  CALLFUNC(GetBondPtr(), GetIssueTypePurchase); }
const char * CBondInfoDebug::GetIssueStartDate()const{  CALLFUNC(GetBondPtr(kReadField_sIssueStartDate), GetIssueStartDate); }
const char * CBondInfoDebug::GetIssueEndDate()const{  CALLFUNC(GetBondPtr(kReadField_sIssueEndDate), GetIssueEndDate); }
const char * CBondInfoDebug::GetIssueEndTime()const{  CALLFUNC(GetBondPtr(kReadField_sIssueEndTime), GetIssueEndTime); }
const char * CBondInfoDebug::GetIssuePeriod()const{  CALLFUNC(GetBondPtr(kReadField_sIssuePeriod), GetIssuePeriod); }
int CBondInfoDebug::GetAuctionTimeStart()const {   CALLFUNC(GetBondPtr(kReadField_nAuctionTimeStart), GetAuctionTimeStart); }
int CBondInfoDebug::GetAuctionTimeEnd()const {  CALLFUNC(GetBondPtr(kReadField_nAuctionTimeEnd), GetAuctionTimeEnd); }
const char * CBondInfoDebug::GetWarrant()const{  CALLFUNC(GetBondPtr(kReadField_sWarrant), GetWarrant); }
const char * CBondInfoDebug::GetMainUnderwriters()const{  CALLFUNC(GetBondPtr(kReadField_sMainUnderwriters), GetMainUnderwriters); }
const char * CBondInfoDebug::GetJointUnderwriters()const{  CALLFUNC(GetBondPtr(kReadField_sJointUnderwriters), GetJointUnderwriters); }
const char * CBondInfoDebug::GetUnderwrites()const{  CALLFUNC(GetBondPtr(kReadField_sUnderwrites), GetUnderwrites); }
const char * CBondInfoDebug::GetBidLimitBottom()const{  CALLFUNC(GetBondPtr(kReadField_sBidLimitBottom), GetBidLimitBottom); }
const char * CBondInfoDebug::GetBidLimitTop()const{  CALLFUNC(GetBondPtr(kReadField_sBidLimitTop), GetBidLimitTop); }
const char * CBondInfoDebug::GetAuctionFlr()const{  CALLFUNC(GetBondPtr(kReadField_sAuction_Flr), GetAuctionFlr); }
const char * CBondInfoDebug::GetAuctionCap()const{  CALLFUNC(GetBondPtr(kReadField_sAuction_Cap), GetAuctionCap); }
const char * CBondInfoDebug::GetAuctionStep()const{  CALLFUNC(GetBondPtr(kReadField_sAuction_Step), GetAuctionStep); }
const char * CBondInfoDebug::GetAuctionUnit()const{  CALLFUNC(GetBondPtr(kReadField_sAuction_Unit), GetAuctionUnit); }
const char * CBondInfoDebug::GetRemainDate()const{  CALLFUNC(GetBondPtr(kReadField_sRemainDate), GetRemainDate); }
const char * CBondInfoDebug::GetCategoryFlag()const { CALLFUNC(GetBondPtr(kReadField_CategoryFlag), GetCategoryFlag); }
std::string CBondInfoDebug::GetBondName()const{  CALLFUNC(GetBondPtr(kReadField_sFullName), GetBondName); }
int	CBondInfoDebug::GetFieldByOffset(int offset, void* buf, int capcity, int& type)const {  CALLFUNC4(GetBondPtr(), GetFieldByOffset, offset, buf, capcity, type); }
int	CBondInfoDebug::GetMemoryBytes(int& validbytes)const {  CALLFUNC1(GetBondPtr(), GetMemoryBytes, validbytes); }
int CBondInfoDebug::GetStorageBytes(int offset)const {  CALLFUNC1(GetBondPtr(), GetStorageBytes, offset); }
void CBondInfoDebug::RecordRepeatCheck(){ /*CBondInfoImpl::RecordRepeatCheck(); TODO*/ }
CBondInfoImpl* CBondInfoDebug::InternalGetImplPtr()
{
	return GetBondPtr();
}

bool CBondInfoDebug::IsInMemory()const
{
	return m_impl != nullptr;
}
int  CBondInfoDebug::GetBytes()const
{
	int bytes = sizeof(CBondInfoDebug);
	if (m_impl)
	{
		bytes += sizeof(CBondInfoImpl);
	}
	return bytes;
}
